#ifndef __ONLINE_STORAGE_H
#define __ONLINE_STORAGE_H

#include "config.h"

//0 for success other fail
#ifndef OUT
#define OUT
#endif 

struct NetFile
{
	char fileName[512];
	int size;
	int folder;
};

class OnlineStorage
{
public:
	virtual int connect() = 0;
	virtual void disconnect() = 0;
	virtual int get(const char* pathname,char* buffer,size_t size) = 0;
	virtual int put(const char* pathname,const char* buffer,size_t size) = 0;
	virtual int del(const char* pathname) = 0;
	virtual int mkdir(const char* path,const char* name) = 0;
	virtual int rmdir(const char* path,const char* name) = 0;
	virtual struct NetFile* lsdir(const char* path,OUT int* size /* numbner of struct NetFile */) = 0;
	virtual int move(const char* oldPath,const char* newPath) = 0;
	virtual int freespace() = 0;
};

#endif
